
class Result<T>{

  bool success;
  String error;
  String errorDescription;
  int nextPageId;
  T data;


  Result({this.success, this.error, this.errorDescription, this.nextPageId,
      this.data});

  Result.fromJson(Map<String, dynamic> json) {
    success = json["success"];
    error = json["error"];
    errorDescription = json["errorDescription"];
    nextPageId = json["nextPageId"];
    data = json["data"];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> map = new Map<String, dynamic>();
    map['success'] = this.success;
    map['error'] = this.error;
    map['errorDescription'] = this.errorDescription;
    map['nextPageId'] = this.nextPageId;
    map['data'] = this.data;
    return map;
  }

  bool isSuccess() {
    return success;
  }

  bool isTokenExpire(){
    return true;
  }

  String getMessage(){
    return errorDescription;
  }

  @override
  String toString() {
    return 'Result{success: $success, error: $error, errorDescription: $errorDescription, nextPageId: $nextPageId, data: $data}';
  }


}